<template>
  <div class="table_header">
    <el-button type="success" @click="dialogVisible = true">创建</el-button>
    <el-input v-model="search" :suffix-icon="Search" class="table_search" placeholder="搜索用户"/>
  </div>

  <el-table :data="tableData" stripe border
            max-height="700"
            style="width: 100%" >
    <el-table-column label="项目名" prop="username"/>
    <el-table-column label="角色" prop="Role"/>
    <el-table-column fixed="right" label="操作">
      <template #default="scope">
        <el-button link type="primary" size="small" @click="UserDelete(scope.row.username)">编辑</el-button>
        <el-button link type="primary" size="small" @click="UserDelete(scope.row.username)">删除</el-button>
        <el-button link type="primary" size="small" @click="UserDelete(scope.row.username)">添加成员</el-button>
      </template>
    </el-table-column>
  </el-table>

  <el-dialog v-model="dialogVisible" title="用户创建" width="25%">
    <el-form :model="form" label-width="120px">
      <el-form-item label="用户名">
        <el-input v-model="form.username"/>

      </el-form-item>
      <el-form-item label="密码">
        <el-input v-model="form.PassWord"/>
      </el-form-item>

      <el-form-item label="邮箱">
        <el-input v-model="form.Email"/>
      </el-form-item>

    </el-form>

    <template #footer>
      <span class="dialog-footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" @click="OnSubmit">创建</el-button>
      </span>
    </template>
  </el-dialog>

</template>

<script setup>
import {Search} from '@element-plus/icons-vue'


import {onMounted,ref, reactive} from 'vue'

const dialogVisible = ref(false)
</script>


<style scoped lang="scss">
@import "@/styles/table_header.scss";


</style>
